x86/pagewalk: Clean up guest_supports_* predicates
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 2 Mar 2017 14:55:38 +0000 (14:55 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 27 Mar 2017 10:49:25 +0000 (11:49 +0100)
commitc68a88583e588f6fb987f5dcb730817512277a6a
tree40b7e4fce1502f55b6a18052faad500147e75171
parent5b08f85689a8479f947be74563fe993875b9caa9
x86/pagewalk: Clean up guest_supports_* predicates

Switch them to returning bool, and taking const parameters.

Rename guest_supports_superpages() to guest_can_use_l2_superpages() to
indicate which level of pagetables it is actually referring to as well as
indicating that it is more complicated than just control register settings,
and rename guest_supports_1G_superpages() to guest_can_use_l3_superpages() for
consistency.

guest_can_use_l3_superpages() is a static property of the domain, rather than
control register settings, so is switched to take a domain pointer.
hvm_pse1gb_supported() is inlined into its sole user because it isn't strictly
hvm-specific (it is hap-specific) and really should be beside a comment
explaining why the cpuid policy is ignored.

guest_supports_nx() on the other hand refers simply to a control register bit,
and is renamed to guest_nx_enabled().

While cleaning up part of the file, clean up all trailing whilespace, and fix
one comment which accidently refered to PG living in CR4 rather than CR0.

Requested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/guest_walk.c
xen/arch/x86/mm/shadow/multi.c
xen/include/asm-x86/guest_pt.h
xen/include/asm-x86/hvm/hvm.h